-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(typescript): HandlerFunction argument #464
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very clever! I clearly need to step up my conditional typing game 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍🏼
@G-Rath can you do a final review and merge this |
🎉 This PR is included in version 8.5.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
* reverts: "fix(typescript): HandlerFunction argument (#464)" This reverts commit aad9b74. * reverts: "fix(typescript): infer `TTransformed` from `createEventHandler()` options (#459)" This reverts commit d2a0b73. * fix(types): adopt options type from first revert * test(typescript-validate): added explanatory comment for ts validation test
What do you think about revising
HandlerFunction
as follows, to make the argumentTTransformed
if thetransform
option is set andEmitterWebhookEvent<TName>
if not, instead of always the intersection?This fixes the types in cases like: